home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Aliases.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  5.7 KB  |  163 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Aliases.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __ALIASES__
  13. #define __ALIASES__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __APPLETALK__
  23. #include <AppleTalk.h>
  24. /*    #include <OSUtils.h>                                        */
  25. #endif
  26.  
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. /*    #include <SegLoad.h>                                        */
  30. #endif
  31.  
  32. #define rAliasType 'alis'
  33.  
  34. enum  {
  35. /* define alias resolution action rules mask */
  36.     kARMMountVol                = 0x00000001,                    /* mount the volume automatically */
  37.     kARMNoUI                    = 0x00000002,                    /* no user interface allowed during resolution */
  38.     kARMMultVols                = 0x00000008,                    /* search on multiple volumes */
  39.     kARMSearch                    = 0x00000100,                    /* search quickly */
  40.     kARMSearchMore                = 0x00000200,                    /* search further */
  41.     kARMSearchRelFirst            = 0x00000400,                    /* search target on a relative path first */
  42. /* define alias record information types */
  43.     asiZoneName                    = -3,                            /* get zone name */
  44.     asiServerName                = -2,                            /* get server name */
  45.     asiVolumeName                = -1,                            /* get volume name */
  46.     asiAliasName                = 0,                            /* get aliased file/folder/volume name */
  47.     asiParentName                = 1                                /* get parent folder name */
  48. };
  49.  
  50.  
  51. /* define the alias record that will be the blackbox for the caller */
  52.  
  53. #if defined(powerc) || defined (__powerc)
  54. #pragma options align=mac68k
  55. #endif
  56. struct AliasRecord {
  57.     OSType                        userType;                        /* appl stored type like creator type */
  58.     unsigned short                aliasSize;                        /* alias record size in bytes, for appl usage */
  59. };
  60. #if defined(powerc) || defined(__powerc)
  61. #pragma options align=reset
  62. #endif
  63.  
  64. typedef struct AliasRecord AliasRecord;
  65.  
  66. typedef AliasRecord *AliasPtr, **AliasHandle;
  67.  
  68.  
  69. /* alias record information type */
  70.  
  71. typedef short AliasInfoType;
  72.  
  73. typedef pascal Boolean (*MatchAliasFilterProcPtr)(CInfoPBPtr cpbPtr, Boolean *quitFlag, Ptr myDataPtr);
  74.  
  75. enum {
  76.     uppMatchAliasFilterProcInfo = kPascalStackBased
  77.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  78.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CInfoPBPtr)))
  79.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Boolean*)))
  80.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Ptr)))
  81. };
  82.  
  83. #if USESROUTINEDESCRIPTORS
  84. typedef UniversalProcPtr MatchAliasFilterUPP;
  85.  
  86. #define CallMatchAliasFilterProc(userRoutine, cpbPtr, quitFlag, myDataPtr)        \
  87.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMatchAliasFilterProcInfo, (cpbPtr), (quitFlag), (myDataPtr))
  88. #define NewMatchAliasFilterProc(userRoutine)        \
  89.         (MatchAliasFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMatchAliasFilterProcInfo, GetCurrentISA())
  90. #else
  91. typedef MatchAliasFilterProcPtr MatchAliasFilterUPP;
  92.  
  93. #define CallMatchAliasFilterProc(userRoutine, cpbPtr, quitFlag, myDataPtr)        \
  94.         (*(userRoutine))((cpbPtr), (quitFlag), (myDataPtr))
  95. #define NewMatchAliasFilterProc(userRoutine)        \
  96.         (MatchAliasFilterUPP)(userRoutine)
  97. #endif
  98.  
  99. typedef MatchAliasFilterProcPtr AliasFilterProcPtr;
  100.  
  101. #ifdef __cplusplus
  102. extern "C" {
  103. #endif
  104.  
  105.  
  106. /*  create a new alias between fromFile-target and return alias record handle  */
  107.  
  108. extern pascal OSErr NewAlias(const FSSpec *fromFile, const FSSpec *target, AliasHandle *alias)
  109.  TWOWORDINLINE(0x7002, 0xA823);
  110.  
  111. /* create a minimal new alias for a target and return alias record handle */
  112.  
  113. extern pascal OSErr NewAliasMinimal(const FSSpec *target, AliasHandle *alias)
  114.  TWOWORDINLINE(0x7008, 0xA823);
  115.  
  116. /* create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  */
  117.  
  118. extern pascal OSErr NewAliasMinimalFromFullPath(short fullPathLength, const unsigned char *fullPath, ConstStr32Param zoneName, ConstStr31Param serverName, AliasHandle *alias)
  119.  TWOWORDINLINE(0x7009, 0xA823);
  120. #define NewAliasMinimalFromFullpath NewAliasMinimalFromFullPath
  121.  
  122.  
  123. /* given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. */
  124.  
  125. extern pascal OSErr ResolveAlias(const FSSpec *fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged)
  126.  TWOWORDINLINE(0x7003, 0xA823);
  127.  
  128. /* given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. */
  129.  
  130. extern pascal OSErr GetAliasInfo(const AliasHandle alias, AliasInfoType index, Str63 theString)
  131.  TWOWORDINLINE(0x7007, 0xA823);
  132.  
  133. /* 
  134.   given a file spec, return target file spec if input file spec is an alias.
  135.   It resolves the entire alias chain or one step of the chain.  It returns
  136.   info about whether the target is a folder or file; and whether the input
  137.   file spec was an alias or not. 
  138. */
  139.  
  140. extern pascal OSErr ResolveAliasFile(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased)
  141.  TWOWORDINLINE(0x700C, 0xA823);
  142. extern pascal OSErr FollowFinderAlias(const FSSpec *fromFile, AliasHandle alias, Boolean logon, FSSpec *target, Boolean *wasChanged)
  143.  TWOWORDINLINE(0x700F, 0xA823);
  144.  
  145. /* 
  146.    Low Level Routines 
  147.  given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag
  148. */
  149.  
  150. extern pascal OSErr MatchAlias(const FSSpec *fromFile, unsigned long rulesMask, const AliasHandle alias, short *aliasCount, FSSpecArrayPtr aliasList, Boolean *needsUpdate, MatchAliasFilterUPP aliasFilter, void *yourDataPtr)
  151.  TWOWORDINLINE(0x7005, 0xA823);
  152.  
  153. /* given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. */
  154.  
  155. extern pascal OSErr UpdateAlias(const FSSpec *fromFile, const FSSpec *target, AliasHandle alias, Boolean *wasChanged)
  156.  TWOWORDINLINE(0x7006, 0xA823);
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160.  
  161. #endif
  162.  
  163.